<?php

$api = app('Dingo\Api\Routing\Router');

$api->version('V1',[
    'namespace'=>'App\Http\Controllers\Api\V1\Common'
],function ($api){
    $api->group([
        'prefix' => 'common'
    ],function ($api){
        $api->group([
            'prefix' => 'code'
        ],function ($api){
            //发送短信验证码
            $api->put('send','SmsController@send')
                ->middleware('throttle:code')
                ->name('common.code.auth.put');
        });

        $api->group([
            'prefix' => 'captcha'
        ],function ($api){
            //获取验证码
            $api->get('code','CaptchaController@code')
                ->middleware('throttle:captcha')
                ->name('common.captcha.code.get');
        });
    });
});
